﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing.Design;
using System.Reflection;
using System.Windows.Forms;
using System.Windows.Forms.Design;

namespace PropertyGridEx
{
    [AttributeUsage(AttributeTargets.Property)]
    public class TrackbarEditorAttr : Attribute
    {
        private Single _min;
        private Single _max;
        private Int32  _gran;
        private string _prop_name;
        private int _type;

        public Int32 IntMinimum
        {
            get
            {
                return (Int32)this._min;
            }
        }

        public Int32 IntMaximum
        {
            get
            {
                return (Int32)this._max;
            }
        }
        public Int32 Granularity
        {
            get
            {
                return this._gran;
            }
        }
        public Single FloatMinimum
        {
            get
            {
                return this._min;
            }
        }

        public Single FloatMaximum
        {
            get
            {
                return this._max;
            }
        }

        public string PropertyName
        {
            get
            {
                return this._prop_name;
            }
        }

        public Int32 Type
        {
            get
            {
                return this._type;
            }
        }

        public TrackbarEditorAttr(int min, int max,string prop_name)
        {
            this._min= (float)min;
            this._max = (float)max;
            this._prop_name = prop_name;
            this._type = 0;
        }
        public TrackbarEditorAttr(float min, float max, int gran, string prop_name,bool angle)
        {
            this._min = min;
            this._max = max;
            this._gran = gran;
            this._prop_name = prop_name;
            this._type = angle ? 2 : 1;
        }
    }
}
